<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/2/11
 * Time: 22:31
 */

namespace App\Http\Controllers\Admin;


use App\Http\Logics\Admin\FeedbackLogic;
use App\Http\Traits\FeedbackTrait;
use App\Http\Controllers\BaseController;
class FeedbackController extends BaseController
{
    use FeedbackTrait;

    public function replyFeedback()
    {
        $parent_id = $this->parent_id;
        $content = $this->content;
        $data = [
            'parent_id' => $parent_id,
            'content' => $content
        ];
        $response = FeedbackLogic::replyFeedback($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * 获取反馈列表
     * @return string
     */
    public function getFeedbackList()
    {
        $limit = $this->limit;
        $data = [
            'limit' => $limit
        ];
        $response = FeedbackLogic::getFeedbackList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }
}